import Cookies from 'js-cookie'

let cookieKey = process.env.VUE_APP_COOKKIE_KEY
const TokenKey = cookieKey + '-TOKEN'
const UserIdKey = cookieKey + '-USERID'
const SpaceIdKey = cookieKey + '-SPACEID'
const entSpaceIdKey = cookieKey + '-ENTSPACEID'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getUserId() {
  return Cookies.get(UserIdKey)
}

export function setUserId(userId) {
  return Cookies.set(UserIdKey, userId)
}

export function removeUserId() {
  return Cookies.remove(UserIdKey)
}

export function getSpaceId() {
  return Cookies.get(SpaceIdKey)
}

export function setSpaceId(spaceId) {
  return Cookies.set(SpaceIdKey, spaceId)
}

export function removeSpaceId() {
  return Cookies.remove(SpaceIdKey)
}

export function getEntSpaceId() {
  return Cookies.get(entSpaceIdKey)
}

export function setEntSpaceId(spaceId) {
  return Cookies.set(entSpaceIdKey, spaceId)
}

export function removeEntSpaceId() {
  return Cookies.remove(entSpaceIdKey)
}
